#ifndef GROUP_H_INCLUDED
#define GROUP_H_INCLUDED
#include <string>
#include <set>
#include "../user/user.h"

using namespace std;

typedef set<User> user_group;

/// Classe permettant de gérer des groupes de User.
class Group
{
    public:
    /* Constructeurs/desctructeur */
    Group(void);
    Group(string);
    ~Group(void);

    /* Accesseurs */
    string _name(void) const;
    unsigned int _size(void) const;
    set<User> _members(void) const;
    set<User>::iterator _firstUser(void) const;
    set<User>::iterator _lastUser(void) const;
    set<User>::iterator _end(void) const;

    /* Mutateurs */
    void setName(string);
    /* Testeurs */
    bool isEmpty(void);
    bool isMember(const string&);
    //Methodes
    void addMember(User);
    int findBy(string, string);
    User getUserBy(string, string);

    private:
    user_group members;
    string groupname;
};

#endif // GROUP_H_INCLUDED
